/*
 * usmart_config.c
 *
 *  Created on: May 22, 2021
 *      Author: kirk_
 */

#include "usmart_config.h"

/* User function includes */
#include "light.h"
#include "movement.h"
#include "distance.h"
#include "direction.h"
#include "config.h"
#include "ds3231.h"
#include "openmv.h"
#include "patio1.h"
#include "patio2.h"
#include "servo.h"

/* Test function */
uint32_t count_sum(uint32_t a, uint32_t b)
{
	return a+b;
}

struct _m_usmart_nametab usmart_nametab[]=
{
	(void*)read_addr,(const uint8_t*)"read_addr(addr)",
	(void*)write_addr,(const uint8_t*)"write_addr(addr, val)",
	(void*)count_sum,(const uint8_t*)"count_sum(a, b)",
	(void*)print_team,(const uint8_t*)"void print_team(void)",
	(void*)ModifyTime, (const uint8_t*)"void ModifyTime(year, month, day, hour, min, sec)",
	/* User unction */
	(void*)Light_Turn,(const uint8_t*)"Light_Turn(index, state) // state 0:off 1:on 2:toggle",
	(void*)TurnCW, (const uint8_t*)"TurnCW(a);",
	(void*)TurnCCW, (const uint8_t*)"TurnCCW(a);",
	(void*)MoveForward, (const uint8_t*)"MoveForward(d)",
	(void*)MoveBackward, (const uint8_t*)"MoveBackward(d)",
#if Mech_Wheel
	(void*)MoveLeft, (const uint8_t*)"MoveLeft(d)",
	(void*)MoveRight, (const uint8_t*)"MoveRight(d)",
#endif
	(void*)Distance_Get, (const uint8_t*)"uint32_t Distance_Get(uint8_t index)",
	(void*)Direction_Get, (const uint8_t*)"Direction_Get()",
	(void*)Servo_Turn, (const uint8_t*)"void Servo_Turn(uint8_t index, uint8_t angle)",
	/* OpenMV control */
	(void*)OpenMV1, (const uint8_t*)"void OpenMV1(uint8_t s, uint8_t t)",
	(void*)OpenMV2, (const uint8_t*)"void OpenMV2(uint8_t c)",
	(void*)OpenMV3, (const uint8_t*)"void OpenMV3(uint16_t x, uint16_t y, uint16_t r)",
	(void*)OpenMVLog, (const uint8_t*)"void OpenMVLog(void)",
	(void*)OpenMVCtl, (const uint8_t*)"void OpenMVCtl(uint8_t command) //1 line,2 color, 3 block.",
	(void*)OpenMVReset, (const uint8_t*)"void OpenMVReset(void)",
	(void*)OpenMVSet, (const uint8_t*)"void OpenMVSet(void)",
	/* Task */
	(void*)Patio2_RunUsmart,(const uint8_t*)"void Patio2_RunUsmart(uint8_t direction, unt8_t meters) // 0 backward, 1 forward",
	(void*)FishFoodSet, (const uint8_t*)"void FishFoodSet(void)",
	(void*)FishFoodReset, (const uint8_t*)"void FishFoodReset(void)",
	/* test */
	(void*)DistanceAdjust, (const uint8_t*)"uint32_t DistanceAdjust(void)",
	(void*)DistanceAverage, (const uint8_t*)"uint32_t DistanceAverage(uint8_t index, uint8_t times, uint8_t interval)",
	(void*)DistanceGetAngleUsmart, (const uint8_t*)"uint8_t DistanceGetAngleUsmart(void)",
};



struct _m_usmart_dev usmart_dev=
{
	usmart_nametab,
	usmart_init,
	usmart_cmd_rec,
	usmart_exe,
	usmart_scan,
	sizeof(usmart_nametab)/sizeof(struct _m_usmart_nametab),//函数数量
	0,	  	//参数数量
	0,	 	//函数ID
	1,		//参数显示类型,0,10进制;1,16进制
	0,		//参数类型.bitx:,0,数字;1,字符串
	0,	  	//每个参数的长度暂存表,需要MAX_PARM个0初始化
	0,		//函数的参数,需要PARM_LEN个0初始化
};
